(function($){ $(document).ready(function(){ if(!aalInIframe()){ $("div[id*='aal_api_data']").each(function(){ var datadiv=this; var aal_divnumber=datadiv.getAttribute('data-divnumber'); var aal_target=datadiv.getAttribute('data-target'); var aal_relation=datadiv.getAttribute('data-relation'); var aal_postid=datadiv.getAttribute('data-postid'); var aal_apikey=datadiv.getAttribute('data-apikey'); var aal_clickbankid=datadiv.getAttribute('data-clickbankid'); var aal_clickbankgravity=datadiv.getAttribute('data-clickbankgravity'); var aal_notimes=datadiv.getAttribute('data-notimes'); var aal_clickbankcat=datadiv.getAttribute('data-clickbankcat'); var aal_amazonlocal=datadiv.getAttribute('data-amazonlocal'); var aal_amazonid=datadiv.getAttribute('data-amazonid'); var aal_amazoncat=datadiv.getAttribute('data-amazoncat'); var aal_amazondisplaylinks=datadiv.getAttribute('data-amazondisplaylinks'); var aal_amazondisplaywidget=datadiv.getAttribute('data-amazondisplaywidget'); var aal_amazonactive=datadiv.getAttribute('data-amazonactive'); var aal_clickbankactive=datadiv.getAttribute('data-clickbankactive'); var aal_shareasaleid=datadiv.getAttribute('data-shareasaleid'); var aal_shareasaleactive=datadiv.getAttribute('data-shareasaleactive'); var aal_cjactive=datadiv.getAttribute('data-cjactive'); var aal_ebayactive=datadiv.getAttribute('data-ebayactive'); var aal_ebayid=datadiv.getAttribute('data-ebayid'); var aal_bestbuyactive=datadiv.getAttribute('data-bestbuyactive'); var aal_bestbuyid=datadiv.getAttribute('data-bestbuyid'); var aal_walmartactive=datadiv.getAttribute('data-walmartactive'); var aal_walmartid=datadiv.getAttribute('data-walmartid'); var aal_envatoid=datadiv.getAttribute('data-envatoid'); var aal_envatosite=datadiv.getAttribute('data-envatosite'); var aal_envatoactive=datadiv.getAttribute('data-envatoactive'); var aal_rakutenactive=datadiv.getAttribute('data-rakutenactive'); var aal_rakutenid=datadiv.getAttribute('data-rakutenid'); var aal_aurl=datadiv.getAttribute('data-aurl'); var aal_excludewords=datadiv.getAttribute('data-excludewords'); var spydiv=document.getElementById('aalcontent_' + aal_divnumber); var parentdiv=spydiv.parentNode; if(parentdiv.innerHTML=='
=0;i--){ if(alinks[i].key&&alinks[i].url){ parray.unshift(alinks[i]); if(parray.length>notimes) parray.pop(); }} if(insertid&&(alinks[0]||awidgets[0])){ $.ajax({ type: "POST", url: "//autoaffiliatelinks.com/api/acache.php", data: { apikey: aalapidata.apikey, insertid: insertid, parray: parray, amazonwidget: awidgets }, cache: false, }); } aal_replacement(parray,awidgets,response,aalapidata,aal_divnumber,aal_target,aal_relation); }}); }else{ var awidgets; if(response.amazonwidget) var awidgets=response.amazonwidget; aal_replacement(parray,awidgets,response,aalapidata,aal_divnumber,aal_target,aal_relation); }} }); } function aal_replacement(parray,awidgets,response,aalapidata,aal_divnumber,aal_target,aal_relation){ var datadiv=document.getElementById('aal_api_data'); var cssclass=datadiv.getAttribute('data-cssclass'); var disclosure=datadiv.getAttribute('data-disclosure'); var spydiv=document.getElementById('aalcontent_' + aal_divnumber); var parentdiv=spydiv.parentNode; if(parentdiv.innerHTML=='

'+ text_truncate(entry.title,45) +''; awhtml +=''; }); } awhtml +=''; amazonWidget.innerHTML=awhtml; if(parray) parray.forEach(function(entry){ var re2=new RegExp("(?!(?:[^<\\[]+[>\\]]|[^>\\]]+<\/a>))\\b("+ entry.key +")\\b","i"); var re=new RegExp("(?!(?:[^<\\[]+[>\\]]|[^>\\]]+<\/a>))(?!(?:[^<\\[]+[>\\]]|[^>\\]]+<\/h.>))(?!(?:[^<\\[]+[>\\]]|[^>\\]]+<\/script.>))\\b("+ entry.key +")\\b","i"); var mat='$1' + disclosure; rt='go'; aalTree(parentdiv,re,mat); }); if(parray) parray.forEach(function(entry){ $('ul.aal_widget_holder').each(function(i, obj){ $(this).append('
  • ' + entry.key + '
  • '); }); }); var reg='/(?!(?:[^<\[]+[>\]]|[^>\]]+<\/a>))\b($name)\b/imsU'; var rep='$1' + disclosure; document.getElementById('aalcontent_' + aal_divnumber).appendChild(amazonWidget); } function aalParse(obj,strcontent){ if(obj.hasChildNodes()){ var child=obj.firstChild; while (child){ if((child.nodeType===1||child.nodeType===3)&&child.nodeName!='SCRIPT'&&child.nodeName!='A'&&child.nodeName!='IMG'&&child.nodeName[0]!='H'){ if(child.nodeType===3&&child.nodeValue!==null&&child.nodeValue.replace(/\s/g, "").length>2){ var astr=child.nodeValue; strcontent=strcontent + "." + astr; } strcontent=aalParse(child,strcontent); } child=child.nextSibling; }} return strcontent; } function aalTree(obj,re,mat){ if(obj.hasChildNodes()){ var child=obj.firstChild; var con='go'; while (child&&con=='go'){ var p=child.parentNode; if((child.nodeType===1||child.nodeType===3)&&child.nodeName!='SCRIPT'&&child.nodeName!='A'&&child.nodeName!='IMG'&&child.nodeName[0]!='H'){ if(child.nodeType===3&&child.nodeValue!==null&&child.nodeValue.replace(/\s/g, "").length>2){ var astr=child.nodeValue; var rstr=astr.replace(re,mat); if(rstr!=astr){ var newel=document.createElement('div'); newel.innerHTML=rstr; var c=newel.firstChild; while(c){ var d=c.cloneNode(true) p.insertBefore(d, child); c=c.nextSibling; } p.removeChild(child); return 'stop'; }} con=aalTree(child,re,mat); } child=child.nextSibling; }} return 'go'; } function aalInIframe (){ try { return window.self!==window.top; } catch (e){ return true; }} text_truncate=function(str, length, ending){ if(length==null){ length=100; } if(ending==null){ ending='...'; } if(str.length > length){ return str.substring(0, length - ending.length) + ending; }else{ return str; }};})(jQuery); (function(a){a.fn.superfish=function(f){var d=a.fn.superfish,e=d.c,g=a(' »'),k=function(c){var b=a(this),d=j(b);("mouseenter"===c.type||"focusin"===c.type)&&b.children("a").data("follow",!0);clearTimeout(d.sfTimer);b.showSuperfishUl().siblings().hideSuperfishUl()},l=function(c){var b=a(this),f=j(b),e=d.op,g=function(){e.retainPath=-1b.parents("li."+e.hoverClass).length&&(e.onIdle.call(),a.proxy(k, e.$path,c)())};"mouseleave"!==c.type&&"focusout"!==c.type?g():(clearTimeout(f.sfTimer),f.sfTimer=setTimeout(g,e.delay));("mouseleave"===c.type||"focusout"===c.type)&&b.children("a").data("follow",!1)},j=function(c){c.hasClass(e.menuClass)&&a.error("Superfish requires you to update to a version of hoverIntent that supports event-delegation, such as this one: https://github.com/joeldbirch/onHoverIntent");c=c.closest("."+e.menuClass)[0];d.op=d.o[c.serial];return c},m=function(c){var b=a(this),f=b.next("ul"), b=b.data("follow");if(f.length&&(d.op.useClick||!b))c.preventDefault(),f.is(":visible")?a.proxy(l,a(this).parent(),c)():a.proxy(k,a(this).parent(),c)()};return this.addClass(e.menuClass).each(function(){var c=this.serial=d.o.length,b=a.extend({},d.defaults,f),h=a(this),j=h.find("li:has(ul)");b.$path=h.find("li."+b.pathClass).slice(0,b.pathLevels).each(function(){a(this).addClass(b.hoverClass+" "+e.bcClass).filter("li:has(ul)").removeClass(b.pathClass)});d.o[c]=d.op=b;b.autoArrows&&j.children("a").each(function(){a(this).addClass(e.anchorClass).append(g.clone())}); d.op.useClick||(a.fn.hoverIntent&&!d.op.disableHI?h.hoverIntent(k,l,"li:has(ul)"):(h.on("mouseenter","li:has(ul)",k),h.on("mouseleave","li:has(ul)",l)));h.on("focusin","li:has(ul)",k);h.on("focusout","li:has(ul)",l);h.on("click","a",m);j.not("."+e.bcClass).hideSuperfishUl();b.onInit.call(this)})};var g=a.fn.superfish;g.o=[];g.op={};g.c={bcClass:"sf-breadcrumb",menuClass:"sf-js-enabled",anchorClass:"sf-with-ul",arrowClass:"sf-sub-indicator"};g.defaults={hoverClass:"sfHover",pathClass:"overideThisToUse", pathLevels:1,delay:800,animation:{opacity:"show"},animationOut:{opacity:"hide"},speed:"normal",speedOut:"fast",autoArrows:!0,disableHI:!1,useClick:!1,onInit:function(){},onBeforeShow:function(){},onShow:function(){},onHide:function(){},onIdle:function(){}};a.fn.extend({hideSuperfishUl:function(){var f=g.op,d=!0===f.retainPath?f.$path:"";f.retainPath=!1;var e=a("li."+f.hoverClass,this).add(this).not(d).find(">ul").stop(!0,!0).animate(f.animationOut,f.speedOut,function(){e=a(this);e.css("visibility", "hidden").parent().removeClass(f.hoverClass);f.onHide.call(e)});return this},showSuperfishUl:function(){var a=g.op,d=this.addClass(a.hoverClass).find(">ul:hidden").css("visibility","visible");a.onBeforeShow.call(d);d.stop(!0,!0).animate(a.animation,a.speed,function(){a.onShow.call(d)});return this}})})(jQuery); (function($){ $.fn.mobileMenu=function(options){ var defaults={ defaultText: 'Navigate to...', className: 'select-menu', subMenuClass: 'sub-menu', subMenuDash: '–' }, settings=$.extend(defaults, options), el=$(this); $("head").append('') this.each(function(){ el.find('ul').addClass(settings.subMenuClass); $('');this.$searchContainer=t,this.$search=t.find("input");var n=e.call(this);return this._transferTabIndex(),n},t.prototype.bind=function(e,i,t){var o=this,n=i.id+"-results";e.call(this,i,t),i.on("open",function(){o.$search.attr("aria-owns",n),o.$search.trigger("focus")}),i.on("close",function(){o.$search.val(""),o.$search.removeAttr("aria-activedescendant"),o.$search.removeAttr("aria-owns"),o.$search.trigger("focus")}),i.on("enable",function(){o.$search.prop("disabled",!1),o._transferTabIndex()}),i.on("disable",function(){o.$search.prop("disabled",!0)}),i.on("focus",function(e){o.$search.trigger("focus")}),i.on("results:focus",function(e){o.$search.attr("aria-activedescendant",e.data._resultId)}),this.$selection.on("focusin",".select2-search--inline",function(e){o.trigger("focus",e)}),this.$selection.on("focusout",".select2-search--inline",function(e){o._handleBlur(e)}),this.$selection.on("keydown",".select2-search--inline",function(e){if(e.stopPropagation(),o.trigger("keypress",e),o._keyUpPrevented=e.isDefaultPrevented(),e.which===a.BACKSPACE&&""===o.$search.val()){var t=o.$searchContainer.prev(".select2-selection__choice");if(0this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),e.define("select2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.query=function(n,i,o){var s=this;this.current(function(e){var t=null!=e?e.length:0;0=s.maximumSelectionLength?s.trigger("results:message",{message:"maximumSelected",args:{maximum:s.maximumSelectionLength}}):n.call(s,i,o)})},e}),e.define("select2/dropdown",["jquery","./utils"],function(t,e){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t('');return e.attr("dir",this.options.get("dir")),this.$dropdown=e},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),e.define("select2/dropdown/search",["jquery","../utils"],function(s,e){function t(){}return t.prototype.render=function(e){var t=e.call(this),n=s('');return this.$searchContainer=n,this.$search=n.find("input"),t.prepend(n),t},t.prototype.bind=function(e,t,n){var i=this,o=t.id+"-results";e.call(this,t,n),this.$search.on("keydown",function(e){i.trigger("keypress",e),i._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(e){s(this).off("keyup")}),this.$search.on("keyup input",function(e){i.handleSearch(e)}),t.on("open",function(){i.$search.attr("tabindex",0),i.$search.attr("aria-owns",o),i.$search.focus(),window.setTimeout(function(){i.$search.focus()},0)}),t.on("close",function(){i.$search.attr("tabindex",-1),i.$search.removeAttr("aria-activedescendant"),i.$search.removeAttr("aria-owns"),i.$search.val("")}),t.on("focus",function(){t.isOpen()||i.$search.focus()}),t.on("results:all",function(e){null!=e.query.term&&""!==e.query.term||(i.showSearch(e)?i.$searchContainer.removeClass("select2-search--hide"):i.$searchContainer.addClass("select2-search--hide"))}),t.on("results:focus",function(e){i.$search.attr("aria-activedescendant",e.data._resultId)})},t.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},t.prototype.showSearch=function(e,t){return!0},t}),e.define("select2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,i){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,i)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),i=t.length-1;0<=i;i--){var o=t[i];this.placeholder.id===o.id&&n.splice(i,1)}return n},e}),e.define("select2/dropdown/infiniteScroll",["jquery"],function(o){function e(e,t,n,i){this.lastParams={},e.call(this,t,n,i),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return e.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&this.$results.append(this.$loadingMore)},e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("query",function(e){i.lastParams=e,i.loading=!0}),t.on("query:append",function(e){i.lastParams=e,i.loading=!0}),this.$results.on("scroll",function(){var e=o.contains(document.documentElement,i.$loadingMore[0]);if(!i.loading&&e){var t=i.$results.offset().top+i.$results.outerHeight(!1);i.$loadingMore.offset().top+i.$loadingMore.outerHeight(!1)<=t+50&&i.loadMore()}})},e.prototype.loadMore=function(){this.loading=!0;var e=o.extend({},{page:1},this.lastParams);e.page++,this.trigger("query:append",e)},e.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},e.prototype.createLoadingMore=function(){var e=o('
  • '),t=this.options.get("translations").get("loadingMore");return e.html(t(this.lastParams)),e},e}),e.define("select2/dropdown/attachBody",["jquery","../utils"],function(f,a){function e(e,t,n){this.$dropdownParent=n.get("dropdownParent")||f(document.body),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var i=this,o=!1;e.call(this,t,n),t.on("open",function(){i._showDropdown(),i._attachPositioningHandler(t),o||(o=!0,t.on("results:all",function(){i._positionDropdown(),i._resizeDropdown()}),t.on("results:append",function(){i._positionDropdown(),i._resizeDropdown()}))}),t.on("close",function(){i._hideDropdown(),i._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},e.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},e.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t.removeClass("select2"),t.addClass("select2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},e.prototype.render=function(e){var t=f(""),n=e.call(this);return t.append(n),this.$dropdownContainer=t},e.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},e.prototype._attachPositioningHandler=function(e,t){var n=this,i="scroll.select2."+t.id,o="resize.select2."+t.id,s="orientationchange.select2."+t.id,r=this.$container.parents().filter(a.hasScroll);r.each(function(){f(this).data("select2-scroll-position",{x:f(this).scrollLeft(),y:f(this).scrollTop()})}),r.on(i,function(e){var t=f(this).data("select2-scroll-position");f(this).scrollTop(t.y)}),f(window).on(i+" "+o+" "+s,function(e){n._positionDropdown(),n._resizeDropdown()})},e.prototype._detachPositioningHandler=function(e,t){var n="scroll.select2."+t.id,i="resize.select2."+t.id,o="orientationchange.select2."+t.id;this.$container.parents().filter(a.hasScroll).off(n),f(window).off(n+" "+i+" "+o)},e.prototype._positionDropdown=function(){var e=f(window),t=this.$dropdown.hasClass("select2-dropdown--above"),n=this.$dropdown.hasClass("select2-dropdown--below"),i=null,o=this.$container.offset();o.bottom=o.top+this.$container.outerHeight(!1);var s={height:this.$container.outerHeight(!1)};s.top=o.top,s.bottom=o.top+s.height;var r=this.$dropdown.outerHeight(!1),a=e.scrollTop(),l=e.scrollTop()+e.height(),c=ao.bottom+r,d={left:o.left,top:s.bottom},p=this.$dropdownParent;"static"===p.css("position")&&(p=p.offsetParent());var h=p.offset();d.top-=h.top,d.left-=h.left,t||n||(i="below"),u||!c||t?!c&&u&&t&&(i="below"):i="above",("above"==i||t&&"below"!==i)&&(d.top=s.top-h.top-r),null!=i&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+i),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+i)),this.$dropdownContainer.css(d)},e.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},e.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},e}),e.define("select2/dropdown/minimumResultsForSearch",[],function(){function e(e,t,n,i){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=Infinity),e.call(this,t,n,i)}return e.prototype.showSearch=function(e,t){return!(function o(e){for(var t=0,n=0;n');return e.attr("dir",this.options.get("dir")),this.$container=e,this.$container.addClass("select2-container--"+this.options.get("theme")),e.data("element",this.$element),e},u}),e.define("select2/compat/utils",["jquery"],function(r){return{syncCssClasses:function a(e,t,n){var i,o,s=[];(i=r.trim(e.attr("class")))&&r((i=""+i).split(/\s+/)).each(function(){0===this.indexOf("select2-")&&s.push(this)}),(i=r.trim(t.attr("class")))&&r((i=""+i).split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&null!=(o=n(this))&&s.push(o)}),e.attr("class",s.join(" "))}}}),e.define("select2/compat/containerCss",["jquery","./utils"],function(r,a){function l(e){return null}function e(){}return e.prototype.render=function(e){var t=e.call(this),n=this.options.get("containerCssClass")||"";r.isFunction(n)&&(n=n(this.$element));var i=this.options.get("adaptContainerCssClass");if(i=i||l,-1!==n.indexOf(":all:")){n=n.replace(":all:","");var o=i;i=function(e){var t=o(e);return null!=t?t+" "+e:e}}var s=this.options.get("containerCss")||{};return r.isFunction(s)&&(s=s(this.$element)),a.syncCssClasses(t,this.$element,i),t.css(s),t.addClass(n),t},e}),e.define("select2/compat/dropdownCss",["jquery","./utils"],function(r,a){function l(e){return null}function e(){}return e.prototype.render=function(e){var t=e.call(this),n=this.options.get("dropdownCssClass")||"";r.isFunction(n)&&(n=n(this.$element));var i=this.options.get("adaptDropdownCssClass");if(i=i||l,-1!==n.indexOf(":all:")){n=n.replace(":all:","");var o=i;i=function(e){var t=o(e);return null!=t?t+" "+e:e}}var s=this.options.get("dropdownCss")||{};return r.isFunction(s)&&(s=s(this.$element)),a.syncCssClasses(t,this.$element,i),t.css(s),t.addClass(n),t},e}),e.define("select2/compat/initSelection",["jquery"],function(i){function e(e,t,n){n.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=n.get("initSelection"),this._isInitialized=!1,e.call(this,t,n)}return e.prototype.current=function(e,t){var n=this;this._isInitialized?e.call(this,t):this.initSelection.call(null,this.$element,function(e){n._isInitialized=!0,i.isArray(e)||(e=[e]),t(e)})},e}),e.define("select2/compat/inputData",["jquery"],function(r){function e(e,t,n){this._currentData=[],this._valueSeparator=n.get("valueSeparator")||",","hidden"===t.prop("type")&&n.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `